package com.cloud.order.controller;

import com.cloud.order.service.FeignService;
import com.fuzhixuan.cloud.entities.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private FeignService feignService;

    @GetMapping(value = "/getServerPort")
    public String getServerPort() {
        return feignService.getPort();
    }

    @PostMapping(value = "/payment/getById")
    public CommonResult getById(@RequestParam("id") Integer id) {
        return feignService.getById(id);
    }

    @GetMapping(value = "/payment/timeout")
    public String timeOut() {
        return feignService.timeOut();
    }
}
